
#include "headers.h"
#include "database.h"

using namespace database;

#define MODELID_VECTOR_VELCRO 174
#define MODELID_VECTOR_PIN    175
#define MODELID_HARPY         370
#define MODELID_FB_BASE       749
#define MODELID_FB_SKYDIVING  750

#define DESCRIPTIONID_VECTOR_VELCRO 341
#define DESCRIPTIONID_VECTOR_PIN    342
#define DESCRIPTIONID_HARPY         371
#define DESCRIPTIONID_FB_BASE       751
#define DESCRIPTIONID_FB_SKYDIVING  752

#define COST_VECTOR_VELCRO 325.0f
#define COST_VECTOR_PIN    255.0f
#define COST_HARPY         450.0f
#define COST_FB_BASE       0.0f
#define COST_FB_SKYDIVING  0.0f

#define PROPS_VECTOR_VELCRO 0.0f, 3.0f, 0.0f, 12.0f, 1.0f/60.0f
#define PROPS_VECTOR_PIN    0.0f, 3.0f, 0.0f, 12.0f, 1.0f/120.0f
#define PROPS_HARPY         0.0f, 3.0f, 0.0f, 12.0f, 1.0f/60.0f
#define PROPS_FB_BASE       0.0f, 3.0f, 0.0f, 12.0f, 1.0f/120.0f
#define PROPS_FB_SKYDIVING  0.0f, 3.0f, 0.0f, 12.0f, 1.0f/60.0f

static Rig rigs[] = 
{
    /* 000 */ { true, COST_VECTOR_VELCRO, false, MODELID_VECTOR_VELCRO, DESCRIPTIONID_VECTOR_VELCRO, CLID_DARK_BLUE, MFRID_D3, 0, PROPS_VECTOR_VELCRO },
    /* 001 */ { true, COST_VECTOR_VELCRO, false, MODELID_VECTOR_VELCRO, DESCRIPTIONID_VECTOR_VELCRO, CLID_PURPLE, MFRID_D3, 1, PROPS_VECTOR_VELCRO },
    /* 002 */ { true, COST_VECTOR_VELCRO, false, MODELID_VECTOR_VELCRO, DESCRIPTIONID_VECTOR_VELCRO, CLID_KHAKI, MFRID_D3, 2, PROPS_VECTOR_VELCRO },
    /* 003 */ { true, COST_VECTOR_VELCRO, false, MODELID_VECTOR_VELCRO, DESCRIPTIONID_VECTOR_VELCRO, CLID_LILAC, MFRID_D3, 3, PROPS_VECTOR_VELCRO },
    /* 004 */ { true, COST_VECTOR_VELCRO, false, MODELID_VECTOR_VELCRO, DESCRIPTIONID_VECTOR_VELCRO, CLID_YELLOW, MFRID_D3, 4, PROPS_VECTOR_VELCRO },
    /* 005 */ { true, COST_VECTOR_VELCRO, false, MODELID_VECTOR_VELCRO, DESCRIPTIONID_VECTOR_VELCRO, CLID_MAGENTA, MFRID_D3, 5, PROPS_VECTOR_VELCRO },
    /* 006 */ { true, COST_VECTOR_VELCRO, false, MODELID_VECTOR_VELCRO, DESCRIPTIONID_VECTOR_VELCRO, CLID_LIGHT_BLUE, MFRID_D3, 6, PROPS_VECTOR_VELCRO },
    /* 007 */ { true, COST_VECTOR_VELCRO, false, MODELID_VECTOR_VELCRO, DESCRIPTIONID_VECTOR_VELCRO, CLID_LIGHT_GREEN, MFRID_D3, 7, PROPS_VECTOR_VELCRO },
    /* 008 */ { true, COST_VECTOR_VELCRO, false, MODELID_VECTOR_VELCRO, DESCRIPTIONID_VECTOR_VELCRO, CLID_ORANGE, MFRID_D3, 8, PROPS_VECTOR_VELCRO },
    /* 009 */ { true, COST_VECTOR_VELCRO, false, MODELID_VECTOR_VELCRO, DESCRIPTIONID_VECTOR_VELCRO, CLID_WHITE, MFRID_D3, 9, PROPS_VECTOR_VELCRO },
    /* 010 */ { true, COST_VECTOR_PIN, false, MODELID_VECTOR_PIN, DESCRIPTIONID_VECTOR_PIN, CLID_YELLOW, MFRID_D3, 10, PROPS_VECTOR_PIN },
    /* 011 */ { true, COST_VECTOR_PIN, false, MODELID_VECTOR_PIN, DESCRIPTIONID_VECTOR_PIN, CLID_CRIMSON, MFRID_D3, 11, PROPS_VECTOR_PIN },
    /* 012 */ { true, COST_VECTOR_PIN, false, MODELID_VECTOR_PIN, DESCRIPTIONID_VECTOR_PIN, CLID_LIGHT_VIOLET, MFRID_D3, 12, PROPS_VECTOR_PIN },
    /* 013 */ { true, COST_VECTOR_PIN, false, MODELID_VECTOR_PIN, DESCRIPTIONID_VECTOR_PIN, CLID_VIOLET, MFRID_D3, 13, PROPS_VECTOR_PIN },
    /* 014 */ { true, COST_VECTOR_PIN, false, MODELID_VECTOR_PIN, DESCRIPTIONID_VECTOR_PIN, CLID_DARK_BLUE, MFRID_D3, 14, PROPS_VECTOR_PIN },
    /* 015 */ { true, COST_VECTOR_PIN, false, MODELID_VECTOR_PIN, DESCRIPTIONID_VECTOR_PIN, CLID_DARK_GREEN, MFRID_D3, 15, PROPS_VECTOR_PIN },
    /* 016 */ { true, COST_VECTOR_PIN, false, MODELID_VECTOR_PIN, DESCRIPTIONID_VECTOR_PIN, CLID_WHITE, MFRID_D3, 16, PROPS_VECTOR_PIN },
    /* 017 */ { true, COST_HARPY, true, MODELID_HARPY, DESCRIPTIONID_HARPY, CLID_WHITE, MFRID_D3, 45, PROPS_HARPY },
    /* 018 */ { true, COST_HARPY, true, MODELID_HARPY, DESCRIPTIONID_HARPY, CLID_MAGENTA, MFRID_D3, 46, PROPS_HARPY },
    /* 019 */ { true, COST_HARPY, true, MODELID_HARPY, DESCRIPTIONID_HARPY, CLID_YELLOW, MFRID_D3, 47, PROPS_HARPY },
    /* 020 */ { true, COST_HARPY, true, MODELID_HARPY, DESCRIPTIONID_HARPY, CLID_DARK_GREEN, MFRID_D3, 48, PROPS_HARPY },
    /* 021 */ { true, COST_VECTOR_PIN, false, MODELID_VECTOR_PIN, DESCRIPTIONID_VECTOR_PIN, CLID_BLACK, MFRID_D3, 64, PROPS_VECTOR_PIN },
    /* 022 */ { false, COST_FB_BASE, false, MODELID_FB_BASE, DESCRIPTIONID_FB_BASE, CLID_WHITE, MFRID_D3, 70, PROPS_FB_BASE },
    /* 023 */ { false, COST_FB_SKYDIVING, true, MODELID_FB_SKYDIVING, DESCRIPTIONID_FB_SKYDIVING, CLID_WHITE, MFRID_D3, 70, PROPS_FB_SKYDIVING },
    { 0.0f, 0,0,0,0 }
};

unsigned int Rig::getNumRecords(void)
{
    unsigned int result = 0;
    unsigned int i = 0;
    while( rigs[i].nameId != 0 ) i++, result++;
    return result;
}

Rig* Rig::getRecord(unsigned int id)
{
    assert( id >= 0 && id < getNumRecords() );
    return rigs + id;
}